// 封装 request请求
let api = 'http://106.12.150.223:3000';
let request = (url,method,data)=>{
    return new Promise((reslove,reject)=>{
        wx.request({
          url: `${api}${url}`,
          method:method,
          data:method=='POST'?data:null,
          success(res){
            reslove(res)
          },
          fail(err){
            reject(err)
          }
        })
    })
}

// 导出request 请求
module.exports = request;